//
//  CHComplainCountCell.m
//  CarFile
//
//  Created by 陈浩 on 2017/4/12.
//  Copyright © 2017年 陈浩. All rights reserved.
//

#import "CHComplainCountCell.h"

@implementation CHComplainCountCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


+(instancetype)cellForTableView:(UITableView *)tableView{
    
    static NSString *ID = @"CHComplainCountCell";
    CHComplainCountCell *cell = [[CHComplainCountCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    return cell;
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        

        
    }
    return self;
}

-(void)setTs_model:(TS_Model *)ts_model{
    _ts_model = ts_model;
    _datas = @[ts_model.areacn,ts_model.complaintnum,ts_model.untreatednum,ts_model.supervisenum,ts_model.complainrate];
    CGFloat labelW = UIScreenW / _datas.count;
    for (int i = 0; i < _datas.count; i++) {
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake( i *labelW, 0, labelW, 44)];
        label.font = [UIFont systemFontOfSize:12];
        label.textAlignment = NSTextAlignmentCenter;
        label .textColor = [UIColor colorWithHexString:@"333333" alpha:1.0f];
        label.text = _datas[i];
        if (i == _datas.count -1) {
            label.textColor = [UIColor colorWithHexString:@"ff3968" alpha:1.0f];
        }
        [self.contentView addSubview:label];
    }

    
}


-(void)setPj_model:(PJ_Model *)pj_model{
    _pj_model = pj_model;
    _datas = @[pj_model.areacn,pj_model.evaluatenum,pj_model.verygood,pj_model.good,pj_model.bad,pj_model.rate];
    CGFloat labelW = UIScreenW / _datas.count;
    for (int i = 0; i < _datas.count; i++) {
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake( i *labelW, 0, labelW, 44)];
        label.font = [UIFont systemFontOfSize:12];
        label.textAlignment = NSTextAlignmentCenter;
        label .textColor = [UIColor colorWithHexString:@"333333" alpha:1.0f];
        label.text = _datas[i];
        if (i == _datas.count -1) {
            label.textColor = [UIColor colorWithHexString:@"ff3968" alpha:1.0f];
        }
        [self.contentView addSubview:label];
    }
    
    
}



-(void)setDj_model:(DJ_Model *)dj_model{
    _dj_model = dj_model;
    
    _datas = @[dj_model.areacn,dj_model.comnum,dj_model.dockcomnum,dj_model.dockcomrate];
    CGFloat labelW = UIScreenW / _datas.count;
    for (int i = 0; i < _datas.count; i++) {
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake( i *labelW, 0, labelW, 44)];
        label.font = [UIFont systemFontOfSize:12];
        label.textAlignment = NSTextAlignmentCenter;
        label .textColor = [UIColor colorWithHexString:@"333333" alpha:1.0f];
        label.text = _datas[i];
        if (i == _datas.count -1) {
            label.textColor = [UIColor colorWithHexString:@"ff3968" alpha:1.0f];
        }
        [self.contentView addSubview:label];
    }
    
}



@end
